<?php TPL::output('m/header_meta.tpl.htm'); ?>
<style>
    .column_tab ul li {
        width: 50%;
    }
</style>
<div class="tab column_tab">
    <ul>
        <li class="cur tabs" type="is_new"><a href="#">已通过</a></li>
        <li class="tabs" type="is_hot"><a href="#">待审核</a></li>
    </ul>
</div>
<div class="zlsy_list" id="demo">

</div>
<div class="load_more" style="display: none;"><a href="javascript:;"><img src="<?php echo base_url();?>/static/mobile/images/loading.gif"></a></div>
<script src="<?php echo base_url();?>/static/mobile/layui/layui.js"></script>
<script type="text/javascript">
    layui.use('flow', function () {
        var $ = layui.jquery;
        var flow = layui.flow;
        var page= 1;
        var is_verify=0;
        var url = G_BASE_URL + '/column/ajax/get_my_column_page/';
        $(".tabs").click(function(){
            if($(this).attr('type')=='is_new'){
                is_verify=1;
            }else{
                is_verify=0;
            }
            $("#demo").empty();
            load_data(is_verify);
        });
        function load_data(is_verify){
                flow.load({
                    elem: '#demo',
                    end: 'SORRY~!没有了',
                    done: function (page, next) {
                        var lis = [];
                        console.log(url + '?page=' + page+'&is_verify='+is_verify);
                        $.get(url + '?page=' + page+'&is_verify='+is_verify, function (res) {
                                if ((res.rsm.list).length < 1) {
                                    AWS.DingTalk.showToast('', '暂无更多内容');
                                }
                                var html = '';
                                if ((res.rsm.list).length >0) {

                                layui.each(res.rsm.list, function (index, item) {
                                    html += '<div class="list-item"><div class="column-info" style="overflow: hidden">';
                                    html += '<a href="m/column_details/id-' + item.column_id + '"><img src="'+item.column_pic+'" width="60" height="60" class="pull-left" style="width: 60px;border-radius: 5px"></a>';
                                    html += '<div class="pull-right text-info"><h3><a href="m/column_details/id-' + item.column_id + '">'+item.column_name.substr(0,18);
                                    if(item.column_name.length>18){
                                        html += '...';
                                    }
                                    html += '</a></h3>';
                                    html += '<p class="text-color-999"><a href="m/column_details/id-' + item.column_id + '">'+item.column_description.substr(0,38);
                                    if(item.column_description.length>38){
                                        html += '...';
                                    }
                                    html += '</a></p></div></div>';
                                    html += '<div class="column-info-bottom text-color-999">';
                                    html += '<ul class="row">';
                                    html += '<li class="col-xs-4 text-center">文章：'+item.article_count+'</li>';
                                    html += '<li class="col-xs-4 text-center">浏览：'+item.view_count+'</li>';
                                    html += '<li class="col-xs-4 text-center">关注：'+item.focus_count+'</li>';
                                    html += '</ul> </div> </div>';
                                });
                            }
                                lis.push(html);
                                next(lis.join(''), page < res.rsm.pages);
                        }, 'json');
                    }
                });
            
        }
        $(".tabs").eq(0).click();
    });
</script>
<?php TPL::output('m/footer.tpl.htm'); ?>